package com.situ.mall.web.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mall.common.util.JsonResult;
import com.mall.user.model.dto.favorite.UserFavoriteAddRequest;
import com.mall.user.model.vo.UserFavoriteVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 收藏服务 Feign 客户端
 */
@FeignClient(name = "user-api", path = "/favorite", contextId = "favorite-api")
public interface FavoriteFeignService {

    /**
     * 添加收藏
     */
    @PostMapping("/add")
    JsonResult<Long> addFavorite(@RequestBody UserFavoriteAddRequest favoriteAddRequest);

    /**
     * 取消收藏
     */
    @PostMapping("/delete")
    JsonResult<Boolean> removeFavorite(@RequestBody UserFavoriteAddRequest favoriteAddRequest);

    /**
     * 检查是否已收藏
     */
    @GetMapping("/check/{productId}")
    JsonResult<Boolean> checkFavoriteStatus(@PathVariable("productId") Long productId);

    /**
     * 获取用户收藏列表
     */
    @GetMapping("/list")
    JsonResult<Page<UserFavoriteVO>> getUserFavorites(@RequestParam(defaultValue = "1") int current,
                                                      @RequestParam(defaultValue = "10") int pageSize);
} 